package com.example.attendancesystem_1_8;


import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.LinearLayout;

import androidx.fragment.app.Fragment;

//import android.support.v4.app.Fragment;

//即ContactFragment
public class FuncFragment extends Fragment
{
    private ImageButton tab03_ibtn_outside;
    private ImageButton ceshi;
    private LinearLayout l1;
    private int count = 0;

    public FuncFragment()
    {

    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
    {
        return inflater.inflate(R.layout.tab03, container, false);

        //tab03_ibtn_outside = getActivity().findViewById(R.id.tab03_ibtn_outside);
        //ceshi = getActivity().findViewById(R.id.tab03_ibtn_Ceshi);
    }

    public void onActivityCreated(Bundle savedInstanceState)
    {
        super.onActivityCreated(savedInstanceState);


        l1 = getActivity().findViewById(R.id.id_tab_4);
        ceshi = getActivity().findViewById(R.id.tab03_ibtn_Ceshi);

        ceshi.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View view) {
                count++;
                if(count % 2 == 0)
                {
                    l1.setVisibility(View.VISIBLE);
                }
                else
                {
                    l1.setVisibility(View.GONE);
                }
            }
        });
    }
}
